"""
Interface definitions for callbacks in continual learning.

Callbacks inject custom behavior at specific points in the training
and evaluation process, enabling flexible extensions without modifying core code.
"""

from typing import Any, Dict

from .core.component import ComponentInterface


class CallbackInterface(ComponentInterface):
    """
    Interface for callback implementations.

    Callbacks are used to inject custom behavior at specific points
    in the training and evaluation process, providing a clean way to
    extend functionality without modifying core training logic.
    """

    def on_train_start(self) -> None:
        """Called at the start of training."""
        pass

    def on_train_end(self) -> None:
        """Called at the end of training."""
        pass

    def on_epoch_start(self, epoch: int) -> None:
        """
        Called at the start of each epoch.

        Args:
            epoch: Current epoch number
        """
        pass

    def on_epoch_end(self, epoch: int) -> None:
        """
        Called at the end of each epoch.

        Args:
            epoch: Current epoch number
        """
        pass

    def on_batch_start(self, batch_idx: int) -> None:
        """
        Called at the start of each batch.

        Args:
            batch_idx: Current batch index
        """
        pass

    def on_batch_end(self, batch_idx: int, outputs: Any) -> None:
        """
        Called at the end of each batch.

        Args:
            batch_idx: Current batch index
            outputs: Batch outputs
        """
        pass

    def on_task_start(self, task_id: int) -> None:
        """
        Called at the start of training a task.

        Args:
            task_id: Current task ID
        """
        pass

    def on_task_end(self, task_id: int) -> None:
        """
        Called at the end of training a task.

        Args:
            task_id: Current task ID
        """
        pass

    def on_evaluation_start(self) -> None:
        """Called at the start of evaluation."""
        pass

    def on_evaluation_end(self, metrics: Dict[str, Any]) -> None:
        """
        Called at the end of evaluation.

        Args:
            metrics: Evaluation metrics
        """
        pass
